//
//  aboutViewController.m
//  ZPSALE
//
//  Created by tmosport on 14-5-16.
//  Copyright (c) 2014年 tmosport. All rights reserved.
//

#import "aboutViewController.h"
#import "MBProgressHUD.h"

@interface aboutViewController ()<UIWebViewDelegate>
{
    MBProgressHUD *hud;
}

@end

@implementation aboutViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

//- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
//    NSURL *url = [request URL];//[url scheme]
////    if ([[url scheme] isEqualToString:@"zpmall"]) { //[url query]
////        [self alipay];//支付环节
////    }
//    return YES;
//}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setNavigationItem];
    self.title = @"关于我们";
    NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"http://m.zhenpin.com/index.php?c=APP_help&a=aboutus"]];
    [_aboutWebView loadRequest:[NSURLRequest requestWithURL:url]];
}
-(void)setNavigationItem {
    
}

-(void)leftBarbuttonItemClicked:(UIButton *)button {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.labelText = @"加载中...";
    hud.dimBackground = NO;
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
//    hud.labelText = @"加载完成";
    [hud hide:YES];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    hud.labelText = @"加载失败";
    [hud hide:YES afterDelay:1];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
